-
Notifications
You must be signed in to change notification settings - Fork 23
refactor(signature_collector): Remove base_hash
#437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the base_hash
field from the signature collector system, as the comment indicating it was needed for different signing roots was incorrect. The actual attestation data is the same for all validators, so the signing root can be used directly instead of maintaining a separate base hash.
- Removed
base_hash
parameter fromSignatureRequester::Committee
variant and all related function calls - Renamed
ValidatorSigningData
toSigningData
to reflect its broader usage beyond just validator signing - Updated all references to use the signing root directly instead of the base hash for committee signature tracking
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
anchor/validator_store/src/lib.rs | Removed base_hash parameter from collect_signature method and all its call sites, replaced logic to use Role::Committee check instead |
anchor/signature_collector/src/lib.rs | Removed base_hash field from SignatureRequester::Committee , renamed ValidatorSigningData to SigningData , updated committee signature tracking to use signing root |
Comments suppressed due to low confidence (1)
anchor/validator_store/src/lib.rs:974
- This line computes
data_hash
but it's no longer used anywhere in the code after removing thebase_hash
parameter. This creates unused code that should be removed.
};
Consider the comment:
This is example incorrect. Only the actual attestation data is signed - which is the same for all validators. Therefore there is no reason for this
base_hash
field to exist - we can simply use the signing root for the same purpose.Additional Info
Also renamed
ValidatorSigningData
toSigningData
now that we also use the data within for committee signature tracking purposes.